#pragma once
#include <iostream>
#include <cstdarg>

enum LogLevel
{
    DEBUG,
    INFO,
    WARNING,
    FATAL
};

void log(LogLevel level, const char *format, ...)
{
    va_list args;
    va_start(args, format);

    switch (level)
    {
    case DEBUG:
        std::cout << "[DEBUG]: ";
        break;
    case INFO:
        std::cout << "[INFO]: ";
        break;
    case WARNING:
        std::cout << "[WARNING]: ";
        break;
    case FATAL:
        std::cout << "[FATAL]: ";
        break;
    default:
        std::cout << "[UNKNOWN LEVEL]: ";
        break;
    }

    vprintf(format, args);
    std::cout << std::endl;

    va_end(args);
}